-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add blockSeparator
option to clipboardTextSerializer
core extension
#5019
Conversation
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Nice idea! const editor = new Editor({
extensions: [
extensions.ClipboardTextSerializer.configure({
blockSeparator: '\n',
}),
],
}); The tiptap/packages/core/src/Editor.ts Lines 56 to 78 in 6f6e49e
That way users would not need to do some weird extension-merging-shenanigans to get the option down to the core extensions.
|
Yes, this approach looks good to me. Will you implement this change? |
@@ -235,7 +238,17 @@ export class Editor extends EventEmitter<EditorEvents> { | |||
* Creates an extension manager. | |||
*/ | |||
private createExtensionManager(): void { | |||
const coreExtensions = this.options.enableCoreExtensions ? Object.values(extensions) : [] | |||
|
|||
const coreExtensions = this.options.enableCoreExtensions ? [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we only have less than 10 core extensions I'd think it's okay to just load them manually here – that way we can pass configurations down to them.
@hivokas I added a commit that adds coreExtension options to the editor options props. |
@svenadlung since I also made changes here it would be best if you could also just review again :) |
Thanks @bdbch! |
Please describe your changes
This PR adds
blockSeparator
option toclipboardTextSerializer
core extension.It will allow to override block separator (without copy pasting the entire extension from core) and add it to my editor.
How did you accomplish your changes
By making it possible to provide
blockSeparator
option toclipboardTextSerializer
core extension.How have you tested your changes
I've copied the implementation from this PR to my project and tested it with and without
blockSeparator
parameter.How can we verify your changes
By doing this:
Remarks
If there is a better way to implement it, I'm open to it.
Checklist
Related issues
N/A